define(function() {
        var bslgallery={
        pick:function(successCB, errorCB,options){
        options = options || {};
            var filename = options.filename||"";//Android - 2.2+ (不支持): 直接返回系统相册中的文件路径，忽略此参数。 
            var filter = options.filter||"image";//默认为选择图片文件
            var animation = options.animation||true;//Android - 2.2+ (不支持): 忽略此参数，无动画效果。
            var popover = options.popover||"";
            var multiple = options.multiple||false;//是否支持多选图片
                
            function success(value){
                var Event = {
                    files:value,
                    init:function(parm){
                         this.files = parm;
                        return this;
                    }
                };
                if (Object.prototype.toString.apply(value) === '[object Array]' ) {
                    var str = Event.init(value);
                    successCB(str);
                }
                else{
                    successCB(value);
                }
            }
            var args =[filename,filter,animation,popover,multiple];
            cordova.exec(success,errorCB,"Gallery","pick",args);
        },
        save:function(path, successCB, errorCB){
            cordova.exec(successCB,errorCB,"Gallery","save",[path]);
        },
    };  
    return bslgallery;
});
